package online.shenme.day08.genericity;

import java.util.Comparator;
import java.util.TreeSet;

public class entry {
    public static void main(String[] args) {
        TreeSet<User> list=new TreeSet<>((o1, o2) -> o1.getAge()-o2.getAge()==0?o1.getName().compareTo(o2.getName()):o1.getAge()-o2.getAge());
        list.add(new User("xiaomin","z001",29));
        list.add(new User("xiaoqiang","z002",18));
        list.add(new User("xiaochun","z003",18));
        list.add(new User());
        System.out.println(list);
    }
}
